package ru.chaykin.measures;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;

public class Mark {
	private Mark() {}
	
	public static FloatBuffer getMark(float[] point, float z, float radius) {
		ByteBuffer bb = ByteBuffer.allocateDirect(12 * 9);
		bb.order(ByteOrder.nativeOrder());
		FloatBuffer bufferMark = bb.asFloatBuffer();
		for (int i=0; i<9; i++) {
			bufferMark.put(point[0] + (float) (radius * Math.sin(i * Math.PI / 4.0)));
			bufferMark.put(point[1] + (float) (radius * Math.cos(i * Math.PI / 4.0)));
			bufferMark.put(z);
		}
		bufferMark.position(0);
		return bufferMark;
	}
}
